/*
 * Cruise.cpp
 *
 *  Created on: Jan 22, 2012
 *      Author: bouchier
 */

#include "qetime.h"
#include "Cruise.h"

Cruise::Cruise(float speed) : Layer(speed) {
	flag = 1;
	layerName = (char *)"Cruise";
	startTime = CQETime::ticks();
	cruiseEnable = 1;
	runTime = 3;
}

void Cruise::eval()
{
	if (CQETime::timeout(runTime, startTime))
		cruiseEnable = 0;
	// run at cruise speed or not based on cruiseEnable
	if (cruiseEnable)
		flag = 1;
	else
		flag = 0;
}
